<template>
  <el-dropdown>
    <span class="el-dropdown-link"><slot name="title" /></span>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item
          v-for="(title, index) of dropdownData"
          :key="index"
          :command="title.value || title.value === 0 ? title.value : title.tip"
          :divided="index === dropdownData.length - 1"
          :disabled="title.disabled"
        >
          {{ title.tip }}
        </el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</template>

<script lang="ts" setup name="T_Dropdown">
import { TipValue } from '@/interfaces/Element/DropDown'

interface DropdownType {
  dropdownData: Array<TipValue>
}
// 默认值
withDefaults(defineProps<DropdownType>(), {})
</script>

<style scoped></style>
